package app.netant.book.ajman;

import cn.lily.com.enviroment.Enviroment;
import app.netant.book.base.BaseDetail;
import app.netant.book.base.BaseEntity;
import app.netant.book.base.BasePage;
import app.netant.book.base.BaseRoot;

public class AjmanRoot extends BaseRoot {
	
	public AjmanRoot(){
		this.homeUrl = "http://www.ajman.cc/junshi/";
		this.pageUrl = "http://www.ajman.cc/junshi/";
		this.tableKey = "ajman";
	}

	@Override
	public String buildUrl(int pageIdx) {
		if(pageIdx == 1){
			return this.homeUrl;
		}else{
			return this.pageUrl + pageIdx+".html";
		}
	}

	@Override
	public BasePage buildPage(String url) {
		return new AjmanPage(url);
	}

	@Override
	public BaseDetail buildDetail(String url) {
		return new AjmanDetail(url);
	}

	@Override
	public BaseEntity buildEntity() {
		return new AjmanEntity();
	}
	
	@Override
	public void afterEntity(BaseEntity entity) {
		
	}
	
	public static void main(String[] args) {
		
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		
		AjmanRoot root = new AjmanRoot();
		root.analyse(111);
		//root.excepCycle();
	}


	
}
